package com.itheima.utils;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @Author weizhongli
 * @Date 2020/4/22
 * @Version v1.0
 * @Description  定时器
 **/
@Component  //注入到spring容器
public class TimeUtil {


    //@Scheduled(fixedRate = 5000,initialDelay = 5000)
    @Scheduled(cron = "*/5 * * * * *")
    public void task01() {
        System.out.println("定时任务执行" + LocalDateTime.now());
    }
}
